package cc.yugu.yhdw.webserver.persistence.basic;

import cc.yugu.yhdw.common.domain.basic.Role;
import cc.yugu.yhdw.common.persistence.MasterMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * 角色下级信息
 *
 * @Date:Created in 2018/6/28 17:26
 * @Author:
 * @Modified By: zjn 2018/6/28 17:26
 */
public interface RoleMapper extends MasterMapper {
    /**
    * 统计行数
    *
    * @Param: [property, value]
    * @Return: int
    * @Author By: zjn 2018/6/28  17:27
    */
    public int hasRecordByProperty(@Param("property") String property, @Param("value") Object value);
    /**
    * 根据主键id查询表bas_role
    *
    * @Param: [id]
    * @Return: cc.yugu.yhdw.common.domain.basic.Role
    * @Author By: zjn 2018/6/29  9:09
    */
    public Role find(int id);
    /**
    * 根据运营商id查询表，并将结果按照主键id降序排列
    *
    * @Param: [agentId]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.basic.Role>
    * @Author By: zjn 2018/6/29  10:48
    */
    public List<Role> findByAgent(int agentId);
    /**
    * 根据条件查询，并返回行数
    *
    * @Param: [search]
    * @Return: int
    * @Author By: zjn 2018/6/29  10:49
    */
    public int findPageCount(Role search);
    /**
    * 根据条件分页查询
    *
    * @Param: [search]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.basic.Role>
    * @Author By: zjn 2018/6/29  10:50
    */
    public List<Role> findPageResult(Role search);
    /**
    * 插入数据
    *
    * @Param: [role]
    * @Return: int
    * @Author By: zjn 2018/6/29  10:52
    */
    public int insert(Role role);
    /**
    * 根据主键id更新 指定数据
    *
    * @Param: [role]
    * @Return: int
    * @Author By: zjn 2018/6/29  10:52
    */
    public int update(Role role);
    /**
    * 根据主键id删除数据
    *
    * @Param: [id]
    * @Return: int
    * @Author By: zjn 2018/6/29  10:52
    */
    public int delete(int id);
    /**
    * 根据主键id删除数据
    *
    * @Param: [id]
    * @Return: int
    * @Author By: zjn 2018/6/29  10:53
    */
    public int deleteByAgent(int id);
}
